package yifeng.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class T4 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 ExecutorService executorService = Executors.newFixedThreadPool(2);
		 
		 executorService.execute(new Runnable() {
             @Override
             public void run() {
                     doSomething(1);
             }
     });
		 
		 
		 System.out.println("111");
	}
	
	 private static void doSomething(int id) {
         System.out.println("start do " + id + " task ...");
         try {
                 Thread.sleep(1000 * 2);
         } catch (InterruptedException e) {
                 e.printStackTrace();
         }
         System.out.println("start do " + id + " finished.");
 }

}
